/*
 * Error.h
 *
 *  Created on: Sep 9, 2013
 *      Author: alexandru
 */
#include <string.h>
#include <iostream>

#ifndef ERROR_H_
#define ERROR_H_

#define ERROR_OBJECT_NAME "error"
#define ERROR_QUERY_FIRST_ARGUMENT_MISPELLED "first argument is mispelled, you should try SELECT, DELETE or UPDATE"
#define ERROR_INDEX_OUT_OF_RANGE "index out of range at "
#define ERROR_NAME_OUT_OF_RANGE "name out of range at "

namespace stn {

namespace ErrorStatusCodes{
	const int syntax_error_query_in_range = 2350;
	const int syntax_error_query_in_argument = 2350;
	const int range_error_query_in_range_firstarg = 2350;
	const int range_error_query_in_range_secondarg = 2350;
	const int range_error_index_out_of_range = 2350;
	const int range_error_name_out_of_range = 2350;

}

class Error {

private:
	std::string gravitate;
	std::string mesaj;
	int cod;

public:
	static std::string SINTAX_ERROR;
	static std::string RANGE_ERROR;
	static std::string COMMAND_FAILED;
	static std::string BLOCKER;
	static std::string YOU_SHOULD_NOT_BE_HERE;



	int getStatusCode(){
		return cod;
	}

	std::string getMessage(){
		return mesaj;
	}

	std::string getGravity(){
		return gravitate;
	}

	Error(std::string gravity, std::string message, int statusCode);
	virtual ~Error();


};

} /* namespace stn */
#endif /* ERROR_H_ */
